package com.snopy.datastructure.queue;

import java.util.Collection;
import java.util.Iterator;
import java.util.Queue;

/**
 * @author snopy
 * @version 1.0.0
 * @classname ArrayQueue
 * @description
 * @email 77912204@qq.com
 * @date 2022/02/23 18:00
 */
public class ArrayQueue<E> implements SQueue<E>{

    private static final int DEFAULT_CAPACITY = 10;

    private int modCount = -1;
    private int size;
    /**
     * default empty container
     */
    private static final Object[] DEFAULTCAPATICY_EMPTY_ELEMENTDATA = {};
    private static final Object[] DEFAULT_ELEMENTDATA = {};
    private Object[] elements;

    public ArrayQueue() {
        this.elements = DEFAULTCAPATICY_EMPTY_ELEMENTDATA;
    }

    @Override
    public void add(E e) {
        if (elements==DEFAULTCAPATICY_EMPTY_ELEMENTDATA){
            elements = DEFAULT_ELEMENTDATA;
        }
        elements[size++] = e;
    }

    @Override
    public void off(E e) {

    }

    @Override
    public E poll() {
        return null;
    }

    @Override
    public E peek() {
        return null;
    }
}
